<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>

<body>
    <input type="text" name="input">
    <ul></ul>
    <script>
        let ul = document.querySelector('ul')
        let input = document.querySelector('[name="input"]')
        let obj = {
            data: new Set(),
            set keyWord(word) {
                this.data.add(word)
            },
            get KeyWord() {
                return this.data;
            },
            show() {
                ul.innerHTML = '';
                this.data.forEach(function (value, key, set) {
                    ul.innerHTML += `<li>${value}</li>`
                })
            }
        }
        input.addEventListener('blur', function () {
            obj.keyWord = this.value
            obj.show()
        })
    </script>
</body>

</html>